﻿
@page "/Rpt/Dashboard/Create"
@using nERP.ViewModel.Rpt.DashboardVMs
@using System.ComponentModel.DataAnnotations
@inherits BasePage

<div>
  <ValidateForm @ref="vform" Model="@Model" OnValidSubmit="@Submit" >
    <Row ItemsPerRow="ItemsPerRow.Two" RowType="RowType.Normal">
      <BootstrapInput @bind-Value="@Model.Entity.Monthly"/>
      <BootstrapInput @bind-Value="@Model.Entity.PoAmount"/>
      <BootstrapInput @bind-Value="@Model.Entity.PoAmounted"/>
      <BootstrapInput @bind-Value="@Model.Entity.SoAmount"/>
      <BootstrapInput @bind-Value="@Model.Entity.SoAmounted"/>
      <BootstrapInput @bind-Value="@Model.Entity.PayAmount"/>
      <BootstrapInput @bind-Value="@Model.Entity.PayAmounted"/>
      <BootstrapInput @bind-Value="@Model.Entity.ReceivableAmount"/>
      <BootstrapInput @bind-Value="@Model.Entity.ReceivableAmounted"/>
    </Row>

    <div class="modal-footer table-modal-footer">
      <Button ButtonType="ButtonType.Submit" IsAsync="true" Text="@WtmBlazor.Localizer["Sys.Submit"]"/>
      <Button OnClick="OnClose" Text="@WtmBlazor.Localizer["Sys.Close"]"/>
    </div>

  </ValidateForm>

</div>



@code {
    [Parameter]
    public string id { get; set; }
    [Parameter]
    public string[] ids { get; set; }
    private DashboardVM Model = new DashboardVM();
    private ValidateForm vform { get; set; }
    private async Task Submit(EditContext context)
    {
                        
        
        await PostsForm(vform, "/api/Rpt/Dashboard/Create", (s) => "Sys.OprationSuccess");
    }
    public void OnClose()
    {
        CloseDialog();
    }
    
    protected override async Task OnInitializedAsync()
    {
        
        

        await base.OnInitializedAsync();
    }
}
